export const columns = (that) => {
    return [
        {
            type: 'index',
            title: '序号',
            width: 70,
            align: 'center',
        },
        {
            key: 'createdDate',
            title: '入库时间',
            minWidth: 150,
            align: 'center',
            render: (h, params) => {
                var date;
                if (params.row.createdDate) {
                    date = that.$moment(params.row.createdDate).format('YYYY-MM-DD');
                } else {
                    ''
                }
                return h('div', [
                    date
                ])
            }
        },
        {
            key: 'toStockOrderNo',
            title: '入库单号',
            minWidth: 150,
            align: 'center',
        },
        {
            key: 'amount',
            title: '总金额',
            minWidth: 70,
            align: 'center',
            render: (h, params) => {
                return h('div', [
                    (params.row.amount / 100).toFixed(2)
                ])
            }
        },
        {
            key: 'countAll',
            title: '总数量',
            minWidth: 70,
            align: 'center',
        },
        {
            key: 'action',
            title: '操作',
            align: 'center',
            fixed: 'right',
            width: '175',
            render: (h, params) => {
                return h('div', [
                    h(
                        'Button',
                        {
                            props: {
                                type: 'primary',
                                size: 'small',
                                // disabled: params.row.name == '管理员'
                            },
                            style: {
                                marginRight: '2px'
                            },
                            on: {
                                click: () => {
                                    that.look(params.row)
                                }
                            }
                        },
                        '查看'
                    ),
                    h(
                        'CustomPopTipButton',
                        {
                            props: {
                                confirmTitle: '确定删除？',
                                btnType: 'error',
                                btnSize: 'small',
                                btnText: '删除',
                                // icon: 'md-trash',
                                // disabled: params.row.name === '管理员'
                            },
                            on: {
                                ok: () => {
                                    that.deleteGoods(params.row.id)
                                },
                            },
                        },
                        '删除'
                    )
                ])
            }
        }
    ]
}